<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of sg_normalizesamplematrix</title>
  <meta name="keywords" content="sg_normalizesamplematrix">
  <meta name="description" content="SG_NORMALIZESAMPLEMATRIX">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">simplegabortb-v1.0.0</a> &gt; sg_normalizesamplematrix.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for simplegabortb-v1.0.0&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>sg_normalizesamplematrix
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>SG_NORMALIZESAMPLEMATRIX</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function meh=sg_normalizesamplematrix(meh) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment">SG_NORMALIZESAMPLEMATRIX

   m = sg_normalizesamplematrix(m)

 Normalizes sample matrix for illumination invariance. Each sample 
 (Gabor responses for one point in all frequencies and rotations) is
 normalized so that norm(sample)==1.

 See also: <a href="sg_resp2samplematrix.html" class="code" title="function meh=sg_resp2samplematrix(r,varargin)">SG_RESP2SAMPLEMATRIX</a>

 Authors:
   Jarmo Ilonen, 2004

 $Name: V_1_0_0 $ $Id: <a href="sg_normalizesamplematrix.html" class="code" title="function meh=sg_normalizesamplematrix(meh)">sg_normalizesamplematrix</a>.m,v 1.2 2005-10-12 14:29:45 ilonen Exp $</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="sg_demo01.html" class="code" title="">sg_demo01</a>	SG_DEMO01 Demonstrates the SimpleGabor Toolbox funtionality</li></ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <span class="comment">%SG_NORMALIZESAMPLEMATRIX</span>
0002 <span class="comment">%</span>
0003 <span class="comment">%   m = sg_normalizesamplematrix(m)</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% Normalizes sample matrix for illumination invariance. Each sample</span>
0006 <span class="comment">% (Gabor responses for one point in all frequencies and rotations) is</span>
0007 <span class="comment">% normalized so that norm(sample)==1.</span>
0008 <span class="comment">%</span>
0009 <span class="comment">% See also: SG_RESP2SAMPLEMATRIX</span>
0010 <span class="comment">%</span>
0011 <span class="comment">% Authors:</span>
0012 <span class="comment">%   Jarmo Ilonen, 2004</span>
0013 <span class="comment">%</span>
0014 <span class="comment">% $Name: V_1_0_0 $ $Id: sg_normalizesamplematrix.m,v 1.2 2005-10-12 14:29:45 ilonen Exp $</span>
0015 
0016 <a name="_sub0" href="#_subfunctions" class="code">function meh=sg_normalizesamplematrix(meh)</a>
0017 
0018 n=size(meh);
0019 
0020 featlen=n(end);
0021 
0022 <span class="keyword">if</span> length(n)==3
0023   meh=(1./repmat(sqrt(sum(abs(meh).^2,3)),[1,1,featlen])).*meh;
0024   <span class="keyword">return</span>;
0025 <span class="keyword">end</span>;
0026 
0027 
0028 <span class="keyword">if</span> length(n)==2
0029   meh=(1./repmat(sqrt(sum(abs(meh).^2,2)),[1,featlen])).*meh;
0030   <span class="keyword">return</span>;
0031 <span class="keyword">end</span>;
0032 
0033 error(<span class="string">'Could not decipher response structure'</span>);
0034 
0035</pre></div>
<hr><address>Generated on Fri 23-Nov-2007 13:14:20 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>